package org.faesa.masterSlave.slave;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import org.faesa.masterSlave.common.DecodeText;

class DecodeTextImpl extends UnicastRemoteObject implements DecodeText {
	private static final long serialVersionUID = -8963326776274534959L;
	
	public DecodeTextImpl() throws RemoteException {
		super();
	}

	@Override
	public String decodeText(String text, String key, String keyToFind) throws RemoteException {
		String result = Criptografia.decifra(text, key);
		if (result.contains(keyToFind)) {
			return result;
		}
		return null;
	}	
}
